home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 2000 November: Tool Chest / Dev.CD Nov 00 TC Disk 1.toast / Sample Code / Graphics 3D / RAVE Starter Samples / RAVE CommonCode / RAVE Utilities.h < prev   
Encoding:
C/C++ Source or Header  |  2000-09-28  |  2.8 KB  |  78 lines  |  [TEXT/CWIE]

  1. /*
  2.     File:        RAVE Utilities.h
  3.  
  4.     Contains:    RAVE Utilities defines a number of useful functions for working with RAVE,
  5.                 including functions to find the deepest GDevice, loading textures from a PICT
  6.                 resource, and so on. Essentially, it defines a number of pieces of common code
  7.                 that were useful to many of my projects.
  8.  
  9.     Written by: Timothy Carroll    
  10.  
  11.     Copyright:    Copyright © 1998-1999 by Apple Computer, Inc., All Rights Reserved.
  12.  
  13.                 You may incorporate this Apple sample source code into your program(s) without
  14.                 restriction. This Apple sample source code has been provided "AS IS" and the
  15.                 responsibility for its operation is yours. You are not permitted to redistribute
  16.                 this Apple sample source code as "Apple sample source code" after having made
  17.                 changes. If you're going to re-distribute the source, we require that you make
  18.                 it clear in the source that the code was descended from Apple sample source
  19.                 code, but that you've made changes.
  20.  
  21.     Change History (most recent first):
  22.                 7/15/1999    Karl Groethe    Updated for Metrowerks Codewarror Pro 2.1
  23.                 
  24.  
  25. */
  26.  
  27. #ifndef _RAVEUTILITIES_
  28. #define _RAVEUTILITIES_
  29.  
  30. #pragma once
  31.  
  32. #include <RAVE.h>
  33. #include "Common Stuff.h"
  34.  
  35.  
  36. /*****************************************************************************
  37. LOOKUP TABLES
  38.  
  39. I use SIN and COS in a number of places, and we don't need perfect precision,
  40. so we generate a set of lookup tables on 0.5 degree increments.  Most of the
  41. 3D math routines use these lookups to generate matrices.
  42. *****************************************************************************/
  43.  
  44. extern float gSinArray[721]; // [720] = [0]
  45. extern float gCosArray[721]; // [720] = [0]
  46.  
  47. OSStatus InitializeLookups(void);
  48.  
  49.  
  50. /*****************************************************************************
  51. RAVE ENGINE FUNCTIONS
  52.     
  53. FindTextureMappingEngine walks the list of available engines and returns
  54. the first engine capable of Texture Mapping.
  55.  
  56. GetListOfEngines creates a handle filled with references to all engines
  57. available to the application.    
  58. *****************************************************************************/
  59.  
  60. TQAEngine    *FindTextureMappingEngine (TQADevice *device);
  61. OSStatus    GetListOfEngines (GDHandle screen, Handle *list, long *number);
  62.  
  63.  
  64. /*****************************************************************************
  65. TEXTURES
  66.  
  67. LoadTextureFromPictResource loads a PICT resource, draws it into an offscreen
  68. GWorld, creates a RAVE texture, and then detaches it so that the engine is
  69. responsible for managing it.  Complete texture management code would probably
  70. want to make sure that the textures are also available as a GWorld, so that
  71. they can be quickly loaded and unloaded from the card.
  72. *****************************************************************************/
  73.  
  74. TQATexture    *LoadTextureFromPictResource (TQAEngine *engine, short pictID);
  75.  
  76.  
  77. #endif _RAVEUTILITIES_
  78.